Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport][stable-2.16] Always allow "no-other-choice" pre-release dependencies when resolving collection dependency tree #81746

Conversation

webknjaz
Copy link
Member

Backport of PR #81606.

Prior to this patch, when --pre CLI flag was not passed, the dependency resolver would treat concrete collection dependency candidates (Git repositories, subdirs, tarball URLs, or local dirs or files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact references, and the ones being specifically pinned dependencies or user requests, met anywhere in the dependency tree, are allowed unconditionally.

This is achieved by moving the pre-release check from is_satisfied_by() to the find_matches() hook, following the Pip's example.

As a bonus, this change also fixes the situation when a collection pre-releases weren't considered if it didn't have any stable releases. This now works even if --pre wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c3, except for the tests. And it also improves the --pre hint warning to explain that it mostly affects Galaxy/Automation Hub-hosted collection releases.

Ref #73416
Ref #79112
Fixes #79168
Fixes #80048
Resolves #81605

Co-authored-by: Sloane Hertel 19572925+s-hertel@users.noreply.github.com
(cherry picked from commit 7662a05)

SUMMARY

$sbj.

ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION

Special thanks to @pradyunsg for hinting how to process pre-releases in the resolvelib provider correctly.

…g collection dependency tree

PR ansible#81606.

Prior to this patch, when `--pre` CLI flag was not passed, the
dependency resolver would treat concrete collection dependency
candidates (Git repositories, subdirs, tarball URLs, or local dirs or
files etc) as not meeting the requirements.

This patch makes it so pre-releases in any concrete artifact
references, and the ones being specifically pinned dependencies or
user requests, met anywhere in the dependency tree, are allowed
unconditionally.

This is achieved by moving the pre-release check from
`is_satisfied_by()` to the `find_matches()` hook, following the
Pip's example.

As a bonus, this change also fixes the situation when a collection
pre-releases weren't considered if it didn't have any stable releases.
This now works even if `--pre` wasn't requested explicitly.

Finally, this patch partially reverts commit
6f4b4c3, except for the tests. And it
also improves the `--pre` hint warning to explain that it mostly
affects Galaxy/Automation Hub-hosted collection releases.

Ref ansible#73416
Ref ansible#79112
Fixes ansible#79168
Fixes ansible#80048
Resolves ansible#81605

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
(cherry picked from commit 7662a05)
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. backport This PR does not target the devel branch. labels Sep 21, 2023
@sivel sivel merged commit e470954 into ansible:stable-2.16 Sep 26, 2023
78 checks passed
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Sep 26, 2023
@ansible ansible locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport This PR does not target the devel branch. bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants